package com.xzmzhp.dao.maintain.sql;

import com.xzmzhp.pojo.finance.FinanceImg;
import com.xzmzhp.pojo.maintain.LendImgs;
import com.xzmzhp.utils.StringUtils;
import org.apache.ibatis.jdbc.SQL;

import java.util.List;

/**
 * @author: 王源(xm)
 * @create: 2022-04-24 18:21
 * @program: ams
 * @description: 借出记录图片相关sql
 */
public class LendImgsSql {

    /**
     * 批量添加借出记录图片
     * @param lendImgs 借出记录图片数据
     * @return 是否成功
     */
    public String addLendImgs(List<LendImgs> lendImgs){
        return new SQL(){
            {
                INSERT_INTO("lend_imgs");
                for (LendImgs lendImgs1:lendImgs) {
                    if (StringUtils.isNotNull(lendImgs1)){
                        VALUES("lend_url",lendImgs1.getLendUrl());
                        VALUES("lend_id",lendImgs1.getLendId().toString());
                        VALUES("lend_status",lendImgs1.getLendStatus().toString());
                    }
                }
            }
        }.toString();
    }
}
